package com.yy.config;

import com.yy.utils.R;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * create by KongFuning on 2022/7/30
 */
/*
* 全局异常处理器
* */
@RestControllerAdvice
public class GlobalExceptionHandler {

    /*
    * 全局异常处理
    * */
    @ExceptionHandler(Exception.class)
    public R exceptionHandler(Exception ex){
        ex.printStackTrace();
        return R.error("服务器故障，请稍后再试！");
    }

}
